package com.netty.common.entity.mq;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.netty.common.entity.base.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/** Mq消息实体
 * @author LiuXiaoYu
 * @date 2021/10/17- 20:30
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@Accessors(chain = true)
@NoArgsConstructor
public class MqMessage extends BaseEntity {
    /**
     * 消息唯一ID
     */
    @TableId(value = "message_id",type= IdType.INPUT)
    private String messageId;
    /**
     * 消息 - JSON格式
     */
    @TableField(value = "message")
    private String message;
    /**
     * 交换机
     */
    @TableField(value = "exchange")
    private String exchange;
    /**
     * 路由键
     */
    @TableField(value = "routing_key")
    private String routingKey;
    /**
     * 消息状态: 0投递中 1投递成功 2投递失败 3已消费
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * 重试次数
     */
    @TableField(value = "retry_count")
    private Integer retryCount;
//    /**
//     * 下一次重试时间
//     */
//    @TableField(value = "next_try_time")
//    private Date nextTryTime;

}
